const SPEC_NUMBER = "\\d+\\.?\\d*"

export const SKU_SPEC = Object.freeze({
    SPEC_TYPE: [
        { label: "棒", value: "棒", SPEC_REGEX: new RegExp(`(?:D(${SPEC_NUMBER}))\\*(?:L(${SPEC_NUMBER}))`)},
        { label: "管", value: "管" },
        { label: "板", value: "板" },
        { label: "线", value: "线" },
        { label: "带", value: "带" },
        { label: "镜", value: "镜" },
        { label: "环", value: "环" },
        { label: "电焊针", value: "针" },
        { label: "其他小五金件", value: "其他" },
    ],
    SPEC_LENGTH: ["棒", "管", "板", "针"],
    SPEC_WIDTH: ["板", "带"],
    SPEC_THICKNESS: ["板", "带", "镜"],
    SPEC_DIAMETER: ["棒", "管", "线", "镜", "环", "针"],
    SPEC_INNER_D: ["管", "环"],
    SPEC_OTHER: ["其他"],
    SPEC_ECCENTRIC_D: ["针"],
    SPEC_DETECTION: new RegExp("([棒管板线带镜环针])"),
    SPEC_NAME: ["D", "d", "L", "W", "T", "Φ"],
    SPEC_NUMBER,
    SPEC_REGEX_1: new RegExp(`(?:D(${SPEC_NUMBER}))`),
    SPEC_REGEX_2: new RegExp(`(?:d(${SPEC_NUMBER}))`),
    SPEC_REGEX_3: new RegExp(`(?:L(${SPEC_NUMBER}))`),
    SPEC_REGEX_4: new RegExp(`(?:W(${SPEC_NUMBER}))`),
    SPEC_REGEX_5: new RegExp(`(?:T(${SPEC_NUMBER}))`),
    SPEC_REGEX_6: new RegExp(`(?:Φ(${SPEC_NUMBER}))`),
});

export const ORDER_SORT_DB = Object.freeze({
    orderId: "order_id",
    clientName: "client_name",
    clientCode: "client_code",
    skuId: "sku_id",
    skuName: "sku_name",
    skuBrand: "sku_brand",
    internalBrand: "internal_brand",
    specification: "specification",
    quantity: "quantity",
    unit: "unit",
    byQuantity: "by_quantity",
    weight: "weight",
    unitPrice: "unit_price",
    amount: "amount",
    actualDeliver: "actual_deliver",
    oweDeliver: "owe_deliver",
    orderState: "order_state",
    orderDt: "order_dt",
    scheduledDt: "scheduled_dt",
    completeDt: "complete_dt",
    remark: "remark",
})